package com.huawei.appmarket.service.settings.view.activity;

import android.annotation.TargetApi;
import android.app.Activity;
import androidx.annotation.NonNull;
import com.huawei.appmarket.service.settings.card.SettingAppSyncCard;
import com.huawei.appmarket.service.settings.view.fragment.SettingsFragment;
import o.der.d;
import o.der.f;
import o.Logger;
import o.ehc;

public class SettingsActivity extends BaseSettingsActivity {
    private ehc ͺ;

    public void onResume() {
        super.onResume();
        SettingAppSyncCard.ˋ((Activity) this);
        ᐝॱ();
    }

    protected String ॱˊ() {
        return getString(f.ॱᐝ);
    }

    protected void ͺ() {
        new SettingsFragment().ˋ(ˏॱ(), d.ᐧ, "SettingsFragment");
    }

    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        Logger.ˎ("SettingsActivity", "requestCode=" + i);
        ˏ(i, -1, null);
        if (14 != i) {
            return;
        }
        if (iArr == null || iArr.length == 0) {
            Logger.ˎ("SettingsActivity", "grantResults == null || grantResults.length == 0");
            ʼॱ();
            return;
        }
        for (int i2 : iArr) {
            if (i2 == -1) {
                Logger.ˎ("SettingsActivity", "grantResults= " + i2);
                ʼॱ();
                return;
            }
        }
    }

    @TargetApi(24)
    private void ʼॱ() {
        Logger.ˎ("SettingsActivity", " showPermissionTipsDialog ");
        boolean shouldShowRequestPermissionRationale = shouldShowRequestPermissionRationale("android.permission.READ_PHONE_STATE");
        if (this.ͺ == null) {
            this.ͺ = new ehc();
        }
        this.ͺ.showDial(this, shouldShowRequestPermissionRationale, f.ˊﾟ, 14);
    }
}
